﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using DotSpatial.Data;

using System.Drawing;

using FXnaInfrastructure;

using DotSpatial.Topology;

using System.ComponentModel;




namespace FXnaGis
{
    [Serializable]
    /// <summary>
    /// 所有基础图形的基类，目前只表示矢量图形
    /// </summary>
    public abstract class FShape:FEntity
    {
        public FShape(string id):base(id)
        {

         



           

 
        }





        FVectorLayer _parent;

        [Browsable(false)]
        public virtual FVectorLayer Parent
        {
            get { return _parent; }
            set { _parent = value; }
        }




   

        [Browsable(false)]
        /// <summary>
        /// 用于表示区域以判断相交
        /// 需要注意的是，这里提供的是geo坐标，而不是局部坐标
        /// </summary>
        public virtual Extent Extent
        {
            get { return null; }
            
        }



 

       

        /// <summary>
        /// 方形区域的碰撞检测
        /// </summary>
        /// <param name="envelope"></param>
        /// <returns></returns>
        public abstract bool Intersects(Envelope envelope);


        /// <summary>
        /// 提供物体移动的函数
        /// </summary>
        /// <param name="xOffset"></param>
        /// <param name="yOffset"></param>
        /// <param name="zOffset"></param>
        public virtual void Move(double xOffset,double yOffset,double zOffset)
        {


 
        }
      


        /// <summary>
        /// 组织一个自行绘制的函数
        /// </summary>
        public virtual void Draw(FMapArgs args)
        {


 
        }

        public virtual void DrawLable(FMapArgs args)
        {


            
 
        }





        public override  object Clone()
        {
            FShape cloned = (FShape)base.Clone();

            cloned._parent = this.Parent;
            


            return cloned;

        }

    }
}
